<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>练习1</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>

<body>
    <!-- <script>
        var arr = {name:"张三",age:18,sex:"男"}
        for (const key in arr) {
            document.write(key,arr[key])
        }
        //name张三
        //age18
        //sex男
    </script> -->
    <script>
        var arr = [
            {name:"张三",age:10},
            {name:"李四",age:15},
            {name:"王五",age:20}
        ]
        for (const key of arr) {
            document.write(key)
        }
        for (const key in arr) {
            document.write(arr[key]);
        }
        //[object Object]
        //[object Object]
        //[object Object]
        //0
        //1
        //2
    </script>
</body>

</html>